/**
 * File TestModel.java 
 */
package cstest.model;

import static org.junit.Assert.*;

import javax.swing.DefaultListModel;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import cs.model.*;

/**
 * Package  cstest.model
 * Project ChatSystemG1 - INSA 4INFOA1 - 2013/2014
 * @author Julie DUMONS & Juste OUEDRAOGO
 *
 */
public class TestModel {

	Model m1, m2 ; 
	
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		m2 = new Model();

	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
		m2 = null ; 
	}

	/**
	 * Test method for {@link cs.model.Model#Model()}.
	 */
	@Test
	public void testModel() {
		m1 = new Model();
		assertNotNull(m1) ;
		assertNotNull(m1.getFileToSendModel());
		assertNotNull(m1.getMsgToSendModel());
		assertNotNull(m1.getReceivedFileModel());
		assertNotNull(m1.getReceivedMsgModel());
		assertNotNull(m1.getState());
		assertNotNull(m1.getUserListModel()); 
	}

	/**
	 * Test method for {@link cs.model.Model#getUserListModel()}.
	 */
	@Test
	public void testGetUserListModel() {
		assertTrue(m2.getUserListModel() instanceof DefaultListModel) ; 
	}

	/**
	 * Test method for {@link cs.model.Model#getMsgToSendModel()}.
	 */
	@Test
	public void testGetMsgToSendModel() {
		assertTrue(m2.getMsgToSendModel() instanceof MsgToSendModel) ; 
	}

	/**
	 * Test method for {@link cs.model.Model#getReceivedMsgModel()}.
	 */
	@Test
	public void testGetReceivedMsgModel() {
		assertTrue(m2.getReceivedFileModel() instanceof ReceivedFileModel);
	}

	/**
	 * Test method for {@link cs.model.Model#getState()}.
	 */
	@Test
	public void testGetState() {
		assertTrue(m2.getState() instanceof State);
	}

	/**
	 * Test method for {@link cs.model.Model#getFileToSendModel()}.
	 */
	@Test
	public void testGetFileToSendModel() {
		assertTrue(m2.getFileToSendModel() instanceof FileToSendModel);
	}

	/**
	 * Test method for {@link cs.model.Model#getReceivedFileModel()}.
	 */
	@Test
	public void testGetReceivedFileModel() {
		assertTrue(m2.getReceivedFileModel() instanceof ReceivedFileModel);
	}

}
